import request from '@/utils/request';

const api = {
	LIST: '/uc/address_list',
	ADD: '/uc/address_add',
	UPDATE: '/uc/address_update',
	DEL: '/uc/address_del',
	SET_DEFAULT: '/uc/address_set_default',
	DETAIL: '/uc/address_detail'
}

export async function addressList(queryParams) {
	return request.get(api.LIST, queryParams);
}

export async function addressDetail(id) {
	let params = {
		id: id
	}
	return request.get(api.DETAIL, params);
}

export async function addressAdd(form) {
	return request.post(api.ADD, form);
}

export async function addressUpdate(form) {
	return request.post(api.UPDATE, form);
}

export async function addressDel(id) {
	let params = {
		id: id
	}
	return request.post(api.DEL, params);
}

export async function addressSetDefault(id) {
	let params = {
		id: id
	}
	return request.post(api.SET_DEFAULT, params);
}